import java.io.IOException;
import java.io.RandomAccessFile;


public abstract class File {
	public RandomAccessFile raf;
	public double size() throws IOException{
		return (double) raf.length();
	}
	public int numberOfPages() throws IOException{
		return (int) Math.ceil((size()/512));
	}
	public String byteToString(byte[] b){
		String result = "";
		for(int i=0; i<b.length; i++){
			if(b[i] != 0){
				result += (char)b[i];
			}
		}
		return result;
	}
	public byte[] stringToByte(String s){
		byte[] stringInByte = new byte[s.length()];
		for(int i=0; i<s.length(); i++){
			stringInByte[i] = (byte) s.charAt(i);
		}
		return stringInByte;
	}
	public abstract void createAPage() throws IOException;
//	public abstract byte[] recordToByte(Record record);
	public abstract Record byteToRecord(byte[] bytes);
}
